<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0,minimum-scale=1.0, user-scalable=0"
        name="viewport" />
    <title>2020-8-24刮刮乐特效</title>
    <style>
        #elem,
        #elem2 {
            width: 100%;
            height: 100vh;
            position: relative;
        }
    </style>
</head>

<body>
    <div id="elem"></div>
</body>

<script src="../jq/jquery-3.5.1.min.js"></script>
<script src="./wScratchPad.min.js"></script>
<script>
    $('#elem').wScratchPad({
        size: 50, // The size of the brush/scratch.
        bg: 'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1781619301,3154824405&fm=26&gp=0.jpg', // Background (image path or hex color).
        fg: '#000', // Foreground (image path or hex color).
        realtime: true, // Calculates percentage in realitime.
        scratchDown: null, // Set scratchDown callback.
        scratchUp: null, // Set scratchUp callback.
        scratchMove: null, // Set scratcMove callback.
        cursor: 'crosshair' // Set cursor.
    });
</script>

</html>